﻿
<style>
    .dvFile {
        display: inline-block;
        margin-right: 10px;
    }

        .dvFile .dvimg {
            text-align: center;
            cursor: pointer;
        }

        .dvFile .dvtitle {
            font-size: 12px;
            text-align: center;
        }

    .pCard {
        min-width: 80px;
        text-align: center;
        margin: 0 5px 5px 5px;
    }

    .fa-spin {
        -webkit-animation: fa-spin 2s infinite linear;
        animation: fa-spin 2s infinite linear;
    }

    @-webkit-keyframes fa-spin {
        0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
        }

        100% {
            -webkit-transform: rotate(359deg);
            transform: rotate(359deg);
        }
    }

    @keyframes fa-spin {
        0% {
            -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
        }

        100% {
            -webkit-transform: rotate(359deg);
            transform: rotate(359deg);
        }
    }

    .szhl_getPeoples {
        display: none;
    }

    .szhl_Upload {
        display: none;
    }

    .ystep-lg {
        font-size: 12px;
    }
    /*=======系统管理页面=======*/
    i, b, small, big {
        font-style: normal;
    }

    li {
        list-style: none;
    }

    h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
        font-family: inherit;
        font-weight: normal;
        color: inherit;
    }

    h4, .h4, h5, .h5, h6, .h6 {
        margin-top: 0px;
        margin-bottom: 0px;
    }

    p {
        margin: 0px;
    }

    .margin-lr {
        margin: 0 15px;
    }

    .margin-tb {
        margin: 15px 0;
    }

    .pic-80 {
        width: 80px;
        height: 80px;
    }

    .border-radius {
        border-radius: 1000px;
    }

    .color-333 {
        color: #333;
    }

    .color-666 {
        color: #666;
    }

    .color-999 {
        color: #999;
    }

    .font-12 {
        font-size: 12px;
    }
     
    /*分隔竖线*/
    .vertical-bar {
        color: #999;
        font-size: 13px;
    }
    /*块居中显示*/
    .margin-center {
        margin: 0 auto;
    }

    .add-item {
        margin-bottom: 8px;
    }

    .add-item-label {
        font-weight: normal;
    }

        .add-item-label i {
            color: #ff6450;
        }

    .add-item.add-width {
        width: 45%;
    }

    .add-item.add-width2 {
        width: 65%;
        clear: both;
    }

    .add-widthall {
        clear: both;
    }

    .fl-left {
        float: left;
    }

    .fl-right {
        float: right;
    }

    .clear-all {
        clear: both;
    }

    .fg-item {
        color: #999;
        border-bottom: 1px solid #eaeaea;
        position: relative;
        margin: 20px 0;
    }

        .fg-item span {
            position: absolute;
            top: -15px;
            background: #fff;
            display: inline-block;
            height: 30px;
            line-height: 30px;
            left: 0;
        }

        .fg-item i {
            width: 0;
            display: inline-block;
            position: absolute;
            right: 0;
            top: -10px;
            cursor: pointer;
            height: 20px;
            line-height: 20px;
            width: 50px;
            color: #fff;
            background: #FF7713;
            text-align: center;
            border-radius: 10px;
            font-size: 12px;
            cursor: pointer;
        }
</style>
 
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
  <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]--> 

<script src="/ViewV5/JS/jquery-migrate-1.1.0.min.js"></script>
<script>
    var pmodel = avalon.define({
        $id: "XXFB_WF",
        nowuser: ComFunJS.getnowuser(),//当前用户 
        FormCode: ComFunJS.getQueryString("FormCode"),
        DataID: ComFunJS.getQueryString("ID", ""),//数据ID  
        isHasDataQX: "N",//是否有修改数据得权限（只有当数据创建人是当前人并且是普通表单时才为Y）
        isPC: true,  
        rdm: Math.random(),
        render: function () {
            if (!pmodel.isPC) {
                $("table").hide();
            } 
            if (tempmodel) {
                if (pmodel.DataID) { 
                    tempmodel.inittemp(pmodel.DataID);
                } else {
                    pmodel.isHasDataQX = "Y";
                    tempmodel.inittemp();
                }
                if (pmodel.isPC && parent.layer) {//调整标题
                    if ($("#btnOtherInfo").length > 0) {
                        $("#btnOtherInfo").html("展开"); $('#OtherInfo').hide();//控制详细信息是否隐藏显示
                        $("#btnOtherInfo").click(function () {
                            $('#OtherInfo').toggle();
                            this.innerHTML = (this.innerHTML == '收起' ? '展开' : '收起');
                        });
                    }
                } else { 
                    document.title = tempmodel.name;
                    $("table").show();
                }
            }
            avalon.templateCache = null;


        }, 
        SaveData: function (dom, isjp) {
            if (!pmodel.isPC) {
                $("table").hide();
            }
            var errmsg = "";
            errmsg = pmodel.CheckData();//验证错误
            if (errmsg) {
                top.ComFunJS.winwarning(errmsg);
                if (!pmodel.isPC) {
                    $("table").show();
                }
                return;
            }
            else {

                if (pmodel.isPC) {
                    $(dom).attr("disabled", true).find(".fa").show();//加上转圈样式
                }
                tempmodel.SaveData(function (result) {
                    if ($.trim(result.ErrorMsg) == "") {
                        top.ComFunJS.winsuccess("操作成功");
                        localStorage.removeItem(pmodel.FormCode);
                        $(dom).attr("disabled", false).find(".fa").hide();//加上转圈样式
                       
                    }
                    else {
                        if (pmodel.isPC) {
                            $(dom).attr("disabled", false).find(".fa").hide();//加上转圈样式
                        }
                        if (!pmodel.isPC) {
                            top.ComFunJS.winwarning(result.ErrorMsg);
                            $("table").show();
                        }
                    }
                }, dom);
            }
        },
        CheckData: function () { //验证代码块
            var retmsg = "";
            if (pmodel.isPC) {
                if ($(".szhl_require")) {

                    $(".szhl_require:visible, .szhl_Int:visible, .szhl_Phone:visible").each(function () {
                        var title = $(this).attr("title") ? $(this).attr("title") : "";
                        if ($(this).hasClass("szhl_UEEDIT") && $(this).hasClass("szhl_require") && ($(this).prop("tagName") == "DIV" && $(this).text() == "")) {
                            retmsg = title + $(this).parent().parent().parent().parent().find("label").text() + "不能为空";
                        }
                        else if ($(this).val() == "" && $(this).hasClass("szhl_require") && !$(this).hasClass("szhl_UEEDIT")) {
                            retmsg = title + $(this).parent().prev("label").text().replace('*', '') + "不能为空";
                        } else if ($(this).hasClass("szhl_Int")) {
                            if ($(this).val() == "") {
                                retmsg = title + $(this).parent().prev("label").text().replace('*', '') + "不能为空";
                            }
                            if (!(/^[0-9]*$/.test($(this).val()))) {
                                retmsg = title + $(this).parent().prev("label").text().replace('*', '') + "必须是数字";
                            }
                        }
                        else if ($(this).hasClass("szhl_Phone")) {
                            if ($(this).val() == "") {
                                retmsg = title + $(this).parent().prev("label").text().replace('*', '') + "不能为空";
                            }
                            if (!(/^0?1[3|4|7|5|8][0-9]\d{8}$/.test($(this).val()))) {
                                retmsg = title + $(this).parent().prev("label").text().replace('*', '') + "填写不正确";
                            }
                        }
                        if (retmsg != "") {
                            return false;
                        }

                    })
                }
            }
            else {
                $(".szhl").each(function () {
                    var title = $(this).attr("title") ? $(this).attr("title") : "";
                    if ($(this).hasClass("szhl_require") && $(this).val() == "") {
                        var str = "请输入";
                        if ($(this).find("select").length > 0) {
                            str = "请选择";
                        }
                        retmsg = str + title + $(this).parent().parent().find(".label").text();
                    }
                    else if ($(this).hasClass("szhl_Int") && !(/^\+?[1-9][0-9]*$/.test($(this).val()))) {
                        retmsg = title + $(this).parent().parent().find(".label").text() + "必须是正整数";
                    }
                    else if ($(this).hasClass("szhl_Time") && ComFunJS.compareTime($(this).val(), "")) {
                        retmsg = title + $(this).parent().parent().find(".label").text() + "必须大于当前时间";
                    }
                    else if ($(this).hasClass("szhl_Phone")) {
                        if ($(this).val()) {
                            if (!(/^0?1[3|4|7|5|8][0-9]\d{8}$/.test($(this).val()))) {
                                retmsg = title + $(this).parent().parent().find(".label").text() + "填写不正确";
                            }
                        }
                    }
                    else if ($(this).hasClass("szhl_Float")) {
                        if ($(this).val()) {
                            if (!(/^[0-9]\d*[0-9](\.\d{1,2})?$/.test($(this).val()))) {
                                retmsg = title + $(this).parent().parent().find(".label").text() + "填写不正确";
                            }
                        }
                    }
                    if (retmsg != "") {
                        return false;
                    }

                })

            }
            return retmsg;
        },
        qx: function () {
            parent.layer.closeAll();
        },
        jptj: function (event, dom) {
            if (event.ctrlKey && (event.keyCode == 13 || event.keyCode == 10)) {
                pmodel.SaveData(dom.find(".btnSucc")[0], true);
            }
        }, 
        
    })
     

    //微信预览图片
    var myPhotoBrowserCaptions;
    var urlData = [];
    function fdtp(obj) {
        var str = $(obj).attr("urlid");
        if (!str) {

            $(".mall_pcp").each(function (index, ele) {
                if ($(ele).attr("src")) {
                    $(ele).attr("urlid", urlData.length);
                    urlData.push($(ele).attr("src"));
                }
            });
            myPhotoBrowserCaptions = $.photoBrowser({
                photos: urlData,
                theme: 'dark'
            });
        }

        myPhotoBrowserCaptions.open($(obj).attr("urlid") * 1);
    }
    //微信预览文件
    function ylwj(YLUrl) {
        if (YLUrl) {
            window.location = YLUrl;
        }
    } //# sourceURL=XXFBWF.js;


</script>
<div class="container-fluid ft14" style="margin-top: 20px; margin-bottom: 100px" ms-controller="XXFB_WF" ms-keypress="jptj(event,$(this))">
    <div ms-include-src="'/ViewV5/AppPage/XXFB/XXFB.html'" data-include-rendered='render'></div>
</div>
<table class="table navbar-fixed-bottom toolfootbar" style="background-color: #F8F8F8">
    <tbody></tbody>
</table>
<link href="/ToolS/umeditor122/themes/default/css/umeditor.css" rel="stylesheet" /> 
<script src="/ToolS/umeditor122/umeditor.js" charset="utf-8"></script>
<script src="/ToolS/umeditor122/umeditor.config.js" charset="utf-8"></script> 
